package ru.niir.goodfil.audit.domain;

import ru.niir.goodfil.audit.util.Assert;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * @author: Кирилл
 */
@Entity
public class PasswordChangeEvent extends Event {
    @Column(length = 100)
    private String address;

    @Column(length = 100)
    private String userLogin;

    private PasswordChangeEvent() {
    }

    public PasswordChangeEvent(String ip, String login, String userLogin, String address) {
        Assert.notBlank(ip);
        Assert.notBlank(login);
        Assert.notBlank(address);
        Assert.notBlank(userLogin);

        this.ip = ip;
        this.login = login;
        this.address = address;
        this.userLogin = userLogin;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUserLogin() {
        return userLogin;
    }

    public void setUserLogin(String userLogin) {
        this.userLogin = userLogin;
    }

    @Override
    public String toString() {
        return "PasswordChangeEvent{" +
                "address='" + address + '\'' +
                ", userLogin='" + userLogin + '\'' +
                '}';
    }
}
